﻿using System;
using System.Collections.Generic;


[Serializable]
public class BattleCharactorAttribute:Attribute
{
    private ulong _hp;
    private ulong _mp;
    private ulong _hpMax;
    private ulong _mpMax;

    public ulong HP 
    {
        get 
        {
            return _hp;   
        }
        set 
        {
            if (_hp == value || _hp>_hpMax)
            {
                return;
            }
            _hp = value;
            Attribute.OnValueChange(this.Actor, EnumAttributeItem.BattleCharactor_HP,this);
        }
    }
    public ulong MP
    {
        get
        {
            return _mp;
        }
        set
        {
            if (_mp == value|| _mp>_mpMax)
            {
                return;
            }
            _mp = value;
            Attribute.OnValueChange(this.Actor, EnumAttributeItem.BattleCharactor_MP, this);
        }
    }
    public ulong HPMax
    {
        get
        {
            return _hpMax;
        }
        set
        {
            if (_hpMax == value )
            {
                return;
            }
            _hpMax = value;
            Attribute.OnValueChange(this.Actor, EnumAttributeItem.BattleCharactor_MAXHP, this);
        }
    }
    public ulong MPMax
    {
        get
        {
            return _mpMax;
        }
        set
        {
            if (_mpMax == value)
            {
                return;
            }
            _mpMax = value;
            Attribute.OnValueChange(this.Actor, EnumAttributeItem.BattleCharactor_MAXMP, this);
        }
    }
}
